﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Data.Abstract;

namespace Data
{
    public class SimplePosicion : BaseSimple
    {


        #region Procedimientos
        public SimplePosicion(DataRow dr)
        {
            LoadByDataRow(dr);
        }
        public SimplePosicion() { }
        public SimplePosicion(string Calle, int Numero, string Depto, string Localidad, string Provincia, int Territorio, int IdPersona, string NotaPosicion)
        {
            this._Calle = Calle;
            this._Numero = Numero;
            this._Depto = Depto;
            this._Localidad = Localidad;
            this._Provincia = Provincia;
            this._TerrNum = Territorio;
            this._IdPersona = IdPersona;
            this._Nota = NotaPosicion;
        }
        #endregion
        #region Propiedades

        string _Calle;
        public string Calle
        {
            get { return _Calle; }
            set { _Calle = value; }
        }
        int _Numero;
        public int Numero
        {
            get { return _Numero; }
            set { _Numero = value; }
        }
        string _Depto;
        public string Depto
        {
            get { return _Depto; }
            set { _Depto = value; }
        }
        string _Localidad;
        public string Localidad
        {
            get { return _Localidad; }
            set { _Localidad = value; }
        }
        string _Provincia;
        public string Provincia
        {
            get { return _Provincia; }
            set { _Provincia = value; }
        }
        int _TerrNum;
        public int TerrNum
        {
            get { return _TerrNum; }
            set { _TerrNum = value; }
        }
        decimal _Lat;
        public decimal Lat
        {
            get { return _Lat; }
            set { _Lat = value; }
        }
        decimal _Long;
        public decimal Long
        {
            get { return _Long; }
            set { _Long = value; }
        }
        string _Nota;
        public string Nota
        {
            get { return _Nota; }
            set { _Nota = value; }
        }
        int _IdPersona;
        public int IdPersona
        {
            get { return _IdPersona; }
            set { _IdPersona = value; }
        }

        #endregion
        #region Metodos
        public override void LoadByDataRow(System.Data.DataRow DataRow)
        {
            this.Id = (int)Convert.ToInt16(DataRow["Id"]);
            this.Calle = (DataRow["Calle"] is System.DBNull) ? "" : (string)DataRow["Calle"];
            this.Numero = (int)Convert.ToInt16(DataRow["Numero"]);
            this.Depto = (DataRow["Depto"] is System.DBNull) ? "" : (string)DataRow["Depto"];
            this.Localidad = (DataRow["Localidad"] is System.DBNull) ? "" : (string)DataRow["Localidad"];
            this.Provincia = (DataRow["Provincia"] is System.DBNull) ? "" : (string)DataRow["Provincia"];
            this.TerrNum = (int)Convert.ToInt16(DataRow["TerrNum"]);
            this.Lat = (decimal)Convert.ToInt16(DataRow["Lat"]);
            this.Long = (decimal)Convert.ToInt16(DataRow["Long"]);
            this.Nota = (DataRow["Nota"] is System.DBNull) ? "" : (string)DataRow["Nota"];
            this.IdPersona = (int)Convert.ToInt16(DataRow["IdPersona"]);
        }
        #endregion

    }

}
